package com.felix.clazz;

/**
 * StaticAndNonStatic
 *
 * @author xjh
 * @version 1.0
 * @date 2019-03-22
 */
public class StaticAndNonStatic {
    public static void main(String[] args) {
        Object obj = new Object();
        SuperCaller callerSub = new SubCaller();
        callerSub.call(obj);
    }

    static class Caller extends BaseCaller{
        @Override
        public void call(Object obj) {
            System.out.println("an Object instance in Caller");
            super.call(obj);
        }

        public void call(String str) {
            System.out.println("a String instance in in Caller");
        }
    }

    static class SubCaller extends Caller {
        @Override
        public void call(Object obj) {
            System.out.println("an Object instance in SubCaller");
        }

        @Override
        public void call(String str) {
            System.out.println("a String instance in in SubCaller");
        }
    }

    static class SuperCaller {
        public void call(Object obj) {
            System.out.println("an Object instance in SuperCaller");
        }
    }

    static class BaseCaller extends SuperCaller {
        @Override
        public void call(Object obj) {
            System.out.println("an Object instance in BaseCaller");
        }
    }
}

class Animal {
    public void method() {
        System.out.println("animal");
    }
}

class Dog extends Animal {
    @Override
    public void method() {
        System.out.println("dog");
    }
}


